package cn.hchaojie.camp.day12;

public class DemoThread {
	public static void main(String[] args) {
		// 线程
		Thread thread = new Thread(new Runnable() {
			@Override
			public void run() {
				System.out.println("异步线程。。。");
			}
		});
		thread.start();
		
		Thread thread2 = new MyThread();
		thread2.start();
		
		// 使用lambda表达式创建Runnable
		Thread thread3 = new Thread(() -> {
			System.out.println("lambda表达式创建线程。。。");
		});
		thread3.start();

		System.out.println("主线程执行。。。");
	}
}

class MyThread extends Thread {
	@Override
	public void run() {
		System.out.println("子线程在跑。。。");
	}
}
